package cn.lbwfree.day3_17;

import java.util.Scanner;

/**
 * @date:2020年3月17日
 * @author:lbwfree
 * @number:BASIC-30
 */
//BASIC-30 大数1-1000 阶乘计算
public class Factorial {
	public static void main(String[] args) {
		Scanner inScanner = new Scanner(System.in);
		int n =inScanner.nextInt();
		int[] num =new int[10000];
		num[0]=1;
		int length=1;//是
		for (int i = 1; i <= n; i++) {
			 int p=0;
			 int temp=0; //进位标志
			 
			 while(true)
			 {
				 int T =num[p]*i+temp;
				 num[p]=T%10;
				 temp=T/10;
				 p++;
				 if(num[p]==0 && temp==0&&p>=length )
				 {
					 break;
				 }
				 
			 }
			 length=p;
			 
		}
		for(int i=length-1; i>=0; i--)
		{
			System.out.print(num[i]);
		}
		
	}

}
